// 首页相关的请求管理
import request from '@/utils/request.ts'
import type {HospitalReaponseData,HospitalNameResponseData, LevelResponseData,} from "@/api/home/type.ts";
// 枚举所有请求
enum API{
    //获取医院数据api
    hospital_url='/hosp/hospital/',
    // 获取等级api
    level_url='/cmn/dict/findByDictCode/',
    // 根据关键字获取医院api
    hospital_name_url='/hosp/hospital/findByHosname/'
}
// 请求所有医院数据
export const reqHostital=(page:number,limit:number,hostype='',districtCode='')=>request.get<any,HospitalReaponseData>(API.hospital_url+`${page}/${limit}?hostype=${hostype}&districtCode=${districtCode}`)

//请求等级或地区
export const reqLevel=(dictCode:string)=>request.get<any,LevelResponseData>(API.level_url+`${dictCode}`)

//请求关键字获取医院api
export const reqHospitalName=(hosname:string)=>request.get<any,HospitalNameResponseData>(API.hospital_name_url+`${hosname}`)
